<template>
  <div class="advantage main-item">
        <h2>掌阅精选的优势</h2>
        <div class="tab">
          <div class="tab-menu" >
            <ul @click="toggle(event)">
              <li :class="num==1? 'on':''" :data-num="1" @click="show(1)">
                <h3>内容</h3>
              </li>
              <li :class="num==2? 'on':''" :data-num="2" @click="show(2)">
                <h3>产品</h3>
              </li>
              <li :class="num==3? 'on':''" :data-num="3" @click="show(3)">
                <h3>服务</h3>
              </li>
              <li :class="num==4? 'on':''" :data-num="4" @click="show(4)">
                <h3>智能硬件</h3>
              </li>
            </ul>
          </div>
          <div class="tab-box">
            <div class="swiper-container">
              <div class="swiper-wrapper">
                <div v-if="i==1" class="swiper-slide" style="width: 1200px; margin-right: 25px;">
                  <img src="//b.zhangyue.com/static/img/2.0/ad-content_87b5eab.png" alt="数字阅读资源">
                  <div>
                    <p>20万册电子书资源<br>
                      15万集有声书资源<br>
                      700家优质出版社版权<br>
                      丰富的党史学习数字图书专栏
                    </p>
                    <a href="/product.html" class="hover-btn"><span>查看更多</span><span></span></a>
                  </div>
                </div>
                <div v-else-if="i==2" class="swiper-slide"  style="width: 1200px; margin-right: 25px;">
                  <img src="//b.zhangyue.com/static/img/2.0/ad-content2-2_cfef723.png" alt="数字图书馆软件">
                  <div>
                    <p>功能、内容、服务定制<br>
                      APP、SDK、H5等多种接入方式<br>
                      全面阅读功能及学习工具 <br>
                      AI智能语音朗读<br>
                      EPUB专利编排<br>
  
                    </p>
                    <a href="/product.html#activeIndex=1" class="hover-btn"><span>查看更多</span><span></span></a>
  
                  </div>
                </div>
                <div v-else-if="i==3" class="swiper-slide" style="width: 1200px; margin-right: 25px;">
                  <img src="//b.zhangyue.com/static/img/2.0/ad-content3_32b12a5.png" alt="数字图书馆服务">
                  <div>
                    <p>阅读排名、阅读打卡<br>
                      领导荐书、机构/团队共读<br>
                      机构阅读报告<br>
                      著名作者亲临现场分享<br>
                    </p>
                    <a href="/product.html#activeIndex=2" class="hover-btn"><span>查看更多</span><span></span></a>
                  </div>
                </div>
                <div v-else-if="i==4" class="swiper-slide"  style="width: 1200px; margin-right: 25px;">
                  <img src="//b.zhangyue.com/static/img/2.0/ad-content4_d698ce8.png" alt="数字阅读硬件">
                  <div>
                    <p>数字借阅一体机<br>
                      无需下载，职工扫码即可借书<br>
                      ireader 电子阅读器<br>
                      高效护眼，办公阅读一机两用<br>
  
                    </p>
                    <a href="/product.html#activeIndex=3" class="hover-btn"><span>查看更多</span><span></span></a>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
  </div>
</template>
<script>
export default {
  data() {
        return {
            i:1,
            num:1
        }
    },
    methods:{
      show(i){
            this.i=i;
        },
        toggle(e){
           this.num= event.target.getAttribute('data-num');
        }
    }
}
</script>

<style scoped>

.main-item:nth-child(odd){
  background-color: #f7f8fa;
}
  .advantage{
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  flex-direction: column;
  -webkit-box-align: center;
  align-items: center;
  position: relative;
}
.advantage .tab{
  width: 100%;
}
.advantage .tab .tab-menu{
  height: 48px;
  width: 100%;
  cursor: pointer;
}
.advantage .tab .tab-menu ul{
  display: flex;
  -webkit-box-pack: center;
  justify-content: center;
}
.advantage .tab .tab-menu ul li{
  width: 192px;
  text-align: center;
  line-height: 48px;
  background-color: rgba(0,0,0,.013);
  color: rgba(38,38,38,.6);
  position: relative;
  margin-right: 1px;
  box-sizing: border-box;
}
.advantage .tab .tab-menu ul li::after{
  content: "";
  position: absolute;
  right: -1px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-block;
  width: 1px;
  height: 24px;
  background-color: #d8d8d8;
}
/* 动画效果 */
.advantage .tab .tab-menu ul .on{
  border-radius: 4px 4px 0 0;
  background: rgba(41,121,255,.05);
  color: #2979ff;
  font-weight: 500;
  border-bottom: 2px solid #2979ff;
}
.advantage .tab .tab-menu ul li h3{
  font-size: 22px;
}
.advantage h2{
  font-size: 32px;
  color: #000;
  margin-bottom: 45px;
  font-weight: 500;
  text-align: center;
}






.advantage .tab .tab-box{
  position: relative;
  height: 480px;
  width: 1200px;
  margin: 48px auto 0;
  box-shadow: 0 4px 14px rgb(94 121 159 /15% );
  border-radius: 16px;
}
.advantage .swiper-container {
    margin: 0;
    height: 100%;
}
.swiper-container {
    position: relative;
    overflow: hidden;
    list-style: none;
    padding: 0;
    z-index: 1;
}
.swiper-wrapper{
  position: relative;
  width: 100%;
  height: 100%;
  z-index: 1;
  display: flex;
  transition-property: transform;
  box-sizing: border-box;
}
.style{
  width: 1200px;
  margin-right: 25px;
}

.swiper-slide {
    flex-shrink: 0;
    width: 100%;
    height: 100%;
    position: relative;
    transition-property: transform;
}
.advantage .swiper-slide {
    display: flex;
    -webkit-box-pack: center;
    justify-content: center;
    -webkit-box-align: center;
    align-items: center;
    box-sizing: border-box;
}
.advantage .swiper-slide img {
    height: 480px;
    margin-right: 101px;
}
.advantage .swiper-slide>div {
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    flex-direction: column;
    -webkit-box-align: center;
    align-items: center;
}
.advantage .swiper-slide p {
    text-align: center;
    line-height: 36px;
    font-size: 18px;
}
.hover-btn {
    margin-top: 24px;
    display: flex;
    -webkit-box-pack: center;
    justify-content: center;
    -webkit-box-align: center;
    align-items: center;
    font-size: 12px;
    cursor: pointer;
    min-width: 68px;
}
a {
    text-decoration: none;
    color: #555;
}
.hover-btn span {
    color: #5788D9;
    display: inline-block;
}
.hover-btn span:nth-child(2) {
    transition: transform .5s ease;
    margin-left: 4px;
    width: 15px;
    height: 5px;
    background: url(//b.zhangyue.com/static/img/2.0/hover-btn_d9636f5.png) no-repeat left 50%/100% 100%;
}
.hover-btn span {
    color: #5788D9;
    display: inline-block;
}
</style>